

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>Using DifferentialEquations.jl to solve a set of ODEs &mdash; VehicleModels.jl 0.0.1-rc1 documentation</title>
  

  
  

  

  
  
    

  

  
  
    <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  

  

  
    <link rel="top" title="VehicleModels.jl 0.0.1-rc1 documentation" href="index.html"/>
        <link rel="prev" title="VehicleModels.jl" href="index.html"/> 

  
  <script src="_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav" role="document">

  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
          

          
            <a href="index.html" class="icon icon-home"> VehicleModels.jl
          

          
          </a>

          
            
            
              <div class="version">
                0.0.1
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
                <ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Using <code class="docutils literal"><span class="pre">DifferentialEquations.jl</span></code> to solve a set of ODEs</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
        <a href="index.html">VehicleModels.jl</a>
      </nav>


      
      <div class="wy-nav-content">
        <div class="rst-content">
          

 



<div role="navigation" aria-label="breadcrumbs navigation">
  <ul class="wy-breadcrumbs">
    <li><a href="index.html">Docs</a> &raquo;</li>
      
    <li>Using <code class="docutils literal"><span class="pre">DifferentialEquations.jl</span></code> to solve a set of ODEs</li>
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="_sources/test1.txt" rel="nofollow"> View page source</a>
          
        
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="using-differentialequations-jl-to-solve-a-set-of-odes">
<h1>Using <code class="docutils literal"><span class="pre">DifferentialEquations.jl</span></code> to solve a set of ODEs<a class="headerlink" href="#using-differentialequations-jl-to-solve-a-set-of-odes" title="Permalink to this headline">¶</a></h1>
<p>In this example we use two small packages along with <a class="reference external" href="https://github.com/JuliaDiffEq/ParameterizedFunctions.jl">DifferentialEquations.jl</a> that can be downloaded by typing:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">Pkg</span><span class="o">.</span><span class="n">clone</span><span class="p">(</span><span class="s2">&quot;https://github.com/huckl3b3rry87/VehicleModels.jl&quot;</span><span class="p">)</span>
<span class="n">Pkg</span><span class="o">.</span><span class="n">clone</span><span class="p">(</span><span class="s2">&quot;https://github.com/huckl3b3rry87/PrettyPlots.jl&quot;</span><span class="p">)</span>
</pre></div>
</div>
<p>This is a mock example, but it demonstrates the utility of <code class="docutils literal"><span class="pre">DifferentialEquations.jl</span></code>.</p>
<p>What we are doing is passing the control signals (optimized steering rate and longitudinal jerk) for a large-sized ground vehicle to a set of differential equations that describe the vehicle dynamics.</p>
<p>From the optimized data, we also have all of the states so we compare the results of the two models in this case. The two models should be very close, which they are for the most part, except where the optimized steering rate and longitudinal jerk are very jumpy.</p>
<img alt="_images/position.gif" src="_images/position.gif" />
<p>For a closer look at the end (last optimization) of the static plots, look below.</p>
<p><strong>Taking a look at the states:</strong></p>
<img alt="_images/main.png" src="_images/main.png" />
<p><strong>A closer look at the states and controls:</strong></p>
<img alt="_images/longv.png" src="_images/longv.png" />
<img alt="_images/ax.png" src="_images/ax.png" />
<img alt="_images/jx.png" src="_images/jx.png" />
<img alt="_images/sa.png" src="_images/sa.png" />
<img alt="_images/sr.png" src="_images/sr.png" />
<img alt="_images/yaw.png" src="_images/yaw.png" />
<img alt="_images/yr.png" src="_images/yr.png" />
<img alt="_images/latv.png" src="_images/latv.png" />
<img alt="_images/pp.png" src="_images/pp.png" />
<p><strong>The tire forces are:</strong></p>
<img alt="_images/vt.png" src="_images/vt.png" />
<img alt="_images/lt.png" src="_images/lt.png" />
</div>


           </div>
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
      
        <a href="index.html" class="btn btn-neutral" title="VehicleModels.jl" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2016, Huckleberry Febbo.

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'./',
            VERSION:'0.0.1-rc1',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE:  true
        };
    </script>
      <script type="text/javascript" src="_static/jquery.js"></script>
      <script type="text/javascript" src="_static/underscore.js"></script>
      <script type="text/javascript" src="_static/doctools.js"></script>
      <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

  

  
  
    <script type="text/javascript" src="_static/js/theme.js"></script>
  

  
  
  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.StickyNav.enable();
      });
  </script>
   

</body>
</html>